{template 'common/header'}
<link rel="stylesheet" type="text/css" href="{MODULE_URL}template/style/main.css">

<div class="page-title">基础设置配置管理</div>



	<button type="button" class="btn btn-primary add-article" data-toggle="modal" data-target="#exampleModal" >新增小程序配置文件</button>


<table class="table table-bordered table-hover ">
		<tr>
			<th colspan="2">平台信息</th>
		</tr>
		<tr>
			<td>名称</td>
			<td>{$_W['account']['name']}</td>
		</tr>
		<tr>
			<td>uniacid</td>
			<td>{$_W['account']['uniacid']}</td>
		</tr>
		<tr>
			<td>acid</td>
			<td>{$_W['account']['acid']}</td>
		</tr>
	</table>


<table class="table table-striped table-bordered table-hover">
    <thead>
    <tr >
        <th>SettingId</th>
        <th>名称</th>
		<th>提交时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>

    {loop $manage_info $index $item}
	<tr>
	    <td>{$item['id']}</td>
		<td>{$item['title']}</td>
		<td>{php echo date('Y-m-d H:i:s', $item['add_time'])}</td>

	    <td>
				<a href="{php echo $this->createWebUrl('Settingdel',array('id' => $item['id']))}" onclick="return confirm('你确定要删除吗？')" 
						class="btn btn-danger">删除</a>

			<a class="btn btn-success" href="{php echo url('site/entry/other', array('m' => 'yts_qiye','id'=>$item['id'],'op'=>'edit','setting_id'=>$item['id']));}">管理设置</a>
		</td>
	</tr>
	{/loop}
    </tbody>
</table>
{$_pagination_var}

<div class="modal fade" id="exampleModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel">
		<div class="modal-dialog" role="document">
		  <div class="modal-content">
			<div class="modal-header">
			  <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
			  <h4 class="modal-title" id="exampleModalLabel">创建配置</h4>
			</div>
			<div class="modal-body">
				<div class="alert alert-danger " id="alert_block" role="alert" style="display: none"></div>
			  <form  id="news_setting" action="{php echo $this->createWebUrl('Setting',array('op' => 'news'))}" method="post" enctype="multipart/form-data" >
				<div class="form-group">
				  <label for="recipient-name" class="control-label">配置名称*</label>
				  <input type="text" class="form-control" name="title" id="recipient-name">
				</div>
				<div class="form-group">
				  <label for="recipient-xname" class="control-label">小程序名称*</label>
				  <input type="text" class="form-control" name="sitename" id="recipient-xname">
				</div>
			  </form>
			</div>
			<div class="modal-footer">
			  <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			  <button type="button" class="btn btn-primary" form="news_setting" onclick="pos()">创建</button>
			</div>
		  </div>
		</div>
	  </div>

<script>
function pos() {
	
	if($("#recipient-name").val() == ''){
	
		$('#alert_block').show();
		$('#alert_block').text('请输入配置名称');

		setTimeout(function(){
			$('#alert_block').hide();
		},1000)
		return false;
	}

	if($("#recipient-name").val() == ''){

		$('#alert_block').show();
		$('#alert_block').text('请输入小程序名称');

		setTimeout(function(){
			$('#alert_block').hide();
		},1000)
		return false;

	}

	$("#news_setting").submit();
	$('#exampleModal').modal('hide')
}



</script>


{template 'common/footer'}